library(bigMap)

Load data

D <- as.matrix(read.csv('../sierpinski3d.mtx', sep = '', header = F))

Run Fit-SNE

source('~/FitSNE/fast_tsne.R', chdir = T)
# perplexities
ppx.list <- round(nrow(d) *c(.01, .05, .1, .2, .3, .4, .5, .6, .7, .8, .9, .95, .99), 0)
#
g.list <- lapply(ppx.list, function(ppx) {
  t <- system.time(Y <- fftRtsne(D, perplexity = ppx))
  # structure results as a bigMap instance
  g <- list(dSet = 'S3D', is.distance = T, is.sparse = F, normalize = T, ppx = list(ppx = ppx), ptsne = list(Y = Y), t = t)
  g
})
save(g.list, file = './glist.RData')

Output

# source graph plot
source('../graphs.R')
# load edge matrix
E <- as.matrix(read.csv('../sierpinski3d.edg', sep = '', header = F))
# plot
nulL <- lapply(g.list, function(g) graph.plot(g, E))

hl-Correlation

g.list <- lapply(g.list, function(g) bdm.hlCorr(D, g, zSampleSize = 1000, threads = 4))
save(g.list, file = './glist.RData')
hlTable <- sapply(g.list, function(g) summary(g$hlC)[4])
hlTable <- matrix(round(hlTable, 4), nrow = 1)
colnames(hlTable) <- sapply(g.list, function(g) g$ppx$ppx)
rownames(hlTable) <- c('<hlC>')
knitr::kable(hlTable, caption = 'hl-Correlation') %>%
  kable_styling(full_width = F)
hl-Correlation
20 102 205 410 615 820 1025 1230 1435 1640 1845 1948 2030
<hlC> 0.7214 0.7157 0.7097 0.712 0.7222 0.7172 0.6975 0.7042 0.7253 0.7308 0.7292 0.7231 0.7293

Kary-neighborhood preservation

g.list <- lapply(g.list, function(g) bdm.knp(D, g, k.max = NULL, sampling = 0.9, threads = 4))
save(g.list, file = './glist.RData')
bdm.knp.plot(g.list, ppxfrmt = 0)

Running Times

rTimes <- round(sapply(g.list, function(m) m$t$fitSNE[[3]]), 0)
rTimes <- matrix(rTimes, nrow = 1)
colnames(rTimes) <- sapply(g.list, function(m) m$ppx$ppx)
rownames(rTimes) <- c('FitSNE')
knitr::kable(rTimes, caption = 'Computation times (s)') %>%
  kable_styling(full_width = F)
Computation times (s)
20 102 205 410 615 820 1025 1230 1435 1640 1845 1948 2030
FitSNE 25 17 20 26 33 36 36 36 36 35 36 36 35

Run on: Intel(R) Xeon(R) CPU E31225 @ 3.10GHz, 4 cores, 16GB RAM.